package link.gpt.pojo;

import java.io.Serializable;
import java.util.Date;

/**
 * question
 * @author
 */
public class Question implements Serializable {

   public Question() {
   }

   public Question(Integer id, String title, String detailDesc, Integer answerCount) {
      this.id = id;
      this.title = title;
      this.detailDesc = detailDesc;
      this.answerCount = answerCount;
   }

   /**
    * 问题id
    */
   private Integer id;

   /**
    * 问题名
    */
   private String title;

   /**
    * 问题描述
    */
   private String detailDesc;

   /**
    * 回答次数
    */
   private Integer answerCount;

   /**
    * 最后修改时间
    */
   private Date lastModifyDate;

   private static final long serialVersionUID = 1L;

   public Integer getId() {
      return id;
   }

   public void setId(Integer id) {
      this.id = id;
   }

   public String getTitle() {
      return title;
   }

   public void setTitle(String title) {
      this.title = title;
   }

   public String getDetailDesc() {
      return detailDesc;
   }

   public void setDetailDesc(String detailDesc) {
      this.detailDesc = detailDesc;
   }

   public Integer getAnswerCount() {
      return answerCount;
   }

   public void setAnswerCount(Integer answerCount) {
      this.answerCount = answerCount;
   }

   public Date getLastModifyDate() {
      return lastModifyDate;
   }

   public void setLastModifyDate(Date lastModifyDate) {
      this.lastModifyDate = lastModifyDate;
   }

   @Override
   public boolean equals(Object that) {
      if (this == that) {
         return true;
      }
      if (that == null) {
         return false;
      }
      if (getClass() != that.getClass()) {
         return false;
      }
      Question other = (Question) that;
      return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
              && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
              && (this.getDetailDesc() == null ? other.getDetailDesc() == null : this.getDetailDesc().equals(other.getDetailDesc()))
              && (this.getAnswerCount() == null ? other.getAnswerCount() == null : this.getAnswerCount().equals(other.getAnswerCount()))
              && (this.getLastModifyDate() == null ? other.getLastModifyDate() == null : this.getLastModifyDate().equals(other.getLastModifyDate()));
   }

   @Override
   public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
      result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
      result = prime * result + ((getDetailDesc() == null) ? 0 : getDetailDesc().hashCode());
      result = prime * result + ((getAnswerCount() == null) ? 0 : getAnswerCount().hashCode());
      result = prime * result + ((getLastModifyDate() == null) ? 0 : getLastModifyDate().hashCode());
      return result;
   }

   @Override
   public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append(getClass().getSimpleName());
      sb.append(" [");
      sb.append("Hash = ").append(hashCode());
      sb.append(", id=").append(id);
      sb.append(", title=").append(title);
      sb.append(", detailDesc=").append(detailDesc);
      sb.append(", answerCount=").append(answerCount);
      sb.append(", lastModifyDate=").append(lastModifyDate);
      sb.append(", serialVersionUID=").append(serialVersionUID);
      sb.append("]");
      return sb.toString();
   }
}